//
//  WXSDayDetailHeaderView.m
//  SleepBooks
//
//  Created by Ivan_Yang on 2016/9/21.
//  Copyright © 2016年 rimi. All rights reserved.
//

#import "WXSDayDetailHeaderView.h"

@implementation WXSDayDetailHeaderView

+ (instancetype)loadHeaderView
{
    WXSDayDetailHeaderView * headerView = [[NSBundle mainBundle] loadNibNamed:@"WXSDayDetailHeaderView" owner:nil options:nil].firstObject;
    [headerView setBlurEffectWithView:headerView.SleepAnalyzeView];
    [headerView setBlurEffectWithView:headerView.droolDetailView];
    return headerView;
}

- (void)setBlurEffectWithView:(UIView *)view
{
    UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
    UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:effect];
    effectView.frame = CGRectMake(0, 0, kScreenWidth, 30);
    effectView.alpha = 0.5;
    [view addSubview:effectView];
}

@end
